package world.ztomorrow.push.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import world.ztomorrow.common.dto.RestResp;
import world.ztomorrow.push.dto.resp.BookRankRespDto;
import world.ztomorrow.push.service.HomeService;

import java.util.List;

@RequiredArgsConstructor
@RestController
@RequestMapping("/front/rank")
public class RankController {

    private final HomeService homeService;

    /**
     * 小说点击榜查询接口
     */
    @GetMapping("/visit_rank")
    public RestResp<List<BookRankRespDto>> listVisitRankBooks() {
        return homeService.listVisitRankBooks();
    }

    /**
     * 小说新书榜查询接口
     */
    @GetMapping("/newest_rank")
    public RestResp<List<BookRankRespDto>> listNewestRankBooks() {
        return homeService.listNewestRankBooks();
    }

    /**
     * 小说更新榜查询接口
     */
    @GetMapping("/update_rank")
    public RestResp<List<BookRankRespDto>> listUpdateRankBooks() {
        return homeService.listUpdateRankBooks();
    }
}
